Add "longdesc" attribute to all (non-external) images, containing
authorWil Mahan <wmahan@users.mediawiki.org>
Tue, 12 Oct 2004 00:12:06 +0000 (00:12 +0000)
committerWil Mahan <wmahan@users.mediawiki.org>
Tue, 12 Oct 2004 00:12:06 +0000 (00:12 +0000)
the URL of the image page.

includes/Image.php
includes/Skin.php

index 025c13f..abc4d08 100644 (file)
@@ -195,6 +195,15 @@ class Image
                return $this->title->escapeLocalURL();
        }
 
+       /**
+        * Return the escapeFullURL of this image
+        * @access public
+        */
+       function getEscapeFullURL()
+       {
+               return $this->title->escapeFullURL();
+       }
+
        /**
         * Return the URL of an image, provided its name.
         *
index 41fa58a..0a6a497 100644 (file)
@@ -1781,13 +1781,14 @@ class Skin {
                $alt = str_replace( array('<', '>', '"'), array('&lt;', '&gt;', '&quot;'), $alt );
 
                $u = $nt->escapeLocalURL();
+               $uf = $nt->escapeFullURL();
                if ( $url == '' )
                {
                        $s = wfMsg( 'missingimage', $img->getName() );
                        $s .= "<br>{$alt}<br>{$url}<br>\n";
                } else {
                        $s = '<a href="'.$u.'" class="image" title="'.$alt.'">' .
-                                '<img src="'.$url.'" alt="'.$alt.'" /></a>';
+                                '<img src="'.$url.'" alt="'.$alt.'" longdesc="'.$uf.'" /></a>';
                }
                if ( '' != $align ) {
                        $s = "<div class=\"float{$align}\"><span>{$s}</span></div>";
@@ -1858,6 +1859,7 @@ class Skin {
                }
 
                $u = $img->getEscapeLocalURL();
+               $uf = $img->getEscapeFullURL();
 
                $more = htmlspecialchars( wfMsg( 'thumbnail-more' ) );
                $magnifyalign = $wgContLang->isRTL() ? 'left' : 'right';
@@ -1870,7 +1872,8 @@ class Skin {
                } else {
                        $s .= '<a href="'.$u.'" class="internal" title="'.$alt.'">'.
                                '<img src="'.$thumbUrl.'" alt="'.$alt.'" ' .
-                               'width="'.$boxwidth.'" height="'.$boxheight.'" /></a>';
+                               'width="'.$boxwidth.'" height="'.$boxheight.'" ' .
+                               'longdesc="'.$uf.'" /></a>';
                        if ( $framed ) {
                                $zoomicon="";
                        } else {